home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / pcb51a.zip / PCBLOG.WAS next >
Text File  |  1992-09-20  |  2KB  |  68 lines

  1. ; PCBLOG.WAS v.5.1a - 9/20/92 06:39 AM
  2. ; Copyright (c) 1992, Gregg Hommel, All Rights Reserved
  3.  
  4. ; PCBLOG.WAS is a small Windows Aspect file for ProComm for Windows 1.0 or
  5. ; 1.01. It does little else than log on to a PCBoard system, taking you as
  6. ; far as the Main Board "Command?" prompt.
  7.  
  8. integer watchfor, lang = 0, graph = 0
  9. string prompt_str
  10.  
  11. proc main
  12.    set connection statmsg on
  13.    when target 0 "?" call get_prompt
  14.    watchfor = 1
  15.    while watchfor
  16.    endwhile
  17.    statmsg "Log in completed."
  18.    set connection statmsg off
  19.    exit
  20. endproc
  21.  
  22. ; The following procedure, get_prompt, handles the multitude of possible
  23. ; prompts which PCBoard systems use during log ins, by getting the promnpt
  24. ; line from the terminal, and then examining it for various keywords and
  25. ; phrases.
  26.  
  27. proc get_prompt
  28.    termgets $ROW 0 prompt_str $COL
  29.    if chk_prompt("Command")
  30.       watchfor = 0
  31.    elseif chk_prompt("Enter)=yes?") || chk_prompt("More?") || chk_prompt ("Enter = Yes?")
  32.       transmit "N^M"
  33.    elseif chk_prompt("=no change?") && lang == 0
  34.          transmit "^M"
  35.          lang++
  36.    elseif chk_prompt("Enter)=no?") || chk_prompt("continue?") || chk_prompt("=none?") || chk_prompt("Enter = No?")
  37.       if chk_prompt("graphics") || chk_prompt("Color?") && graph == 0
  38.          transmit "N Q NS^M"
  39.          graph++
  40.       else
  41.          transmit "^M"
  42.       endif
  43.    elseif chk_prompt("Password (Dots")
  44.       transmit $PASSWORD
  45.       transmit "^M"
  46.    elseif chk_prompt("name?")
  47.       transmit $USERID
  48.       transmit " "
  49.       transmit $PASSWORD
  50.       transmit "^M"
  51.    elseif chk_prompt("new user?") || chk_prompt("new caller?")
  52.       transmit "r^M"
  53.    endif
  54. endproc
  55.  
  56. ; This function, chk_prompt, is not normally necessary, since all it does
  57. ; is use the strfind command to locate a keyword or phrase in the prompt
  58. ; string. However, Windows Aspect does not allow multiple strfind commands
  59. ; in a single "if" statment, but it will allow multiple function calls, so
  60. ; this function makes the script more compact.
  61.  
  62. func chk_prompt:integer
  63.    strparm chk_out
  64.    strfind prompt_str chk_out
  65.    return FOUND
  66. endfunc
  67.  
  68.